<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>预定义常量</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="math.resources.html">资源类型</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="ref.math.html">Math 函数</a></div>
 <div class="up"><a href="book.math.html">Math</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="math.constants" class="appendix">
 <h1>预定义常量</h1>

 <p class="simpara">
下列常量作为 PHP 核心的一部分总是可用的。
</p>
 <p class="para">
  <table class="doctable table">
   <caption><strong>数学常量</strong></caption>
   
    <thead>
     <tr>
      <th>常量名</th>
      <th>常量值</th>
      <th>描述</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>M_PI</td>
      <td>3.14159265358979323846</td>
      <td>Pi</td>
     </tr>

     <tr>
      <td>M_E</td>
      <td>2.7182818284590452354</td>
      <td>e</td>
     </tr>

     <tr>
      <td>M_LOG2E</td> 
      <td>1.4426950408889634074</td>
      <td>log_2 e</td>
     </tr>

     <tr>
      <td>M_LOG10E</td>
      <td>0.43429448190325182765</td>
      <td>log_10 e</td>
     </tr>

     <tr>
      <td>M_LN2</td>   
      <td>0.69314718055994530942</td>
      <td>log_e 2</td>
     </tr>

     <tr>
      <td>M_LN10</td>  
      <td>2.30258509299404568402</td>
      <td>log_e 10</td>
     </tr>

     <tr>
      <td>M_PI_2</td>
      <td>1.57079632679489661923</td>
      <td>pi/2</td>
     </tr>

     <tr>
      <td>M_PI_4</td>
     <td>0.78539816339744830962</td>
      <td>pi/4</td>
     </tr>

     <tr>
      <td>M_1_PI</td>
      <td>0.31830988618379067154</td>
      <td>1/pi</td>
     </tr>

     <tr>
      <td>M_2_PI</td>
      <td>0.63661977236758134308</td>
      <td>2/pi</td>
     </tr>

     <tr>
      <td>M_SQRTPI</td>    
      <td>1.77245385090551602729</td>
      <td>sqrt(pi) [5.2.0]</td>
     </tr>

     <tr>
      <td>M_2_SQRTPI</td>  
      <td>1.12837916709551257390</td>
      <td>2/sqrt(pi)</td>
     </tr>

     <tr>
      <td>M_SQRT2</td> 
      <td>1.41421356237309504880</td>
      <td>sqrt(2)</td>
     </tr>

     <tr>
      <td>M_SQRT3</td> 
      <td>1.73205080756887729352</td>
      <td>sqrt(3) [5.2.0]</td>
     </tr>

     <tr>
      <td>M_SQRT1_2</td>   
      <td>0.70710678118654752440</td>
      <td>1/sqrt(2)</td>
     </tr>

     <tr>
      <td>M_LNPI</td>  
      <td>1.14472988584940017414</td>
      <td>log_e(pi) [5.2.0]</td>
     </tr>

     <tr>
      <td>M_EULER</td> 
      <td>0.57721566490153286061</td>
      <td>Euler constant [5.2.0]</td>
     </tr>

    </tbody>
   
  </table>

  只有常量 M_PI 在 PHP 4.0.0 之前就存在，其它所有常量从 PHP 4.0.0
  起开始存在。用 [5.2.0] 标记的常量是在 PHP 5.2.0 中增加的。
 </p>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="math.resources.html">资源类型</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="ref.math.html">Math 函数</a></div>
 <div class="up"><a href="book.math.html">Math</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
